!!! 5
%html
  %head
    %meta{:charset=>"UTF-8"}/
    %title
      JS极简练习
    :css
      li {color: orange;}
      .js li {color: purple;}
    :javascript

      function write_list(a, order=false){
        var tag = order ? 'ol' : 'ul'

        document.write('<'+tag+'>')
        for (var j=0; j<a.length; j++){
          document.write('<li>'+a[j]+'</li>')
        }
        document.write('</'+tag+'>')
      }

      var a = ['HTML', 'CSS', "JavaScript"]
      write_list(a)

  %body
  %div Hello world
  .js
    :javascript
      var a = ["盒子模型", '浮动', '定位', "动画", "排版"]
      write_list(a, order=true)
  %div 你好世界